package com.practice.springboot.rabbitmqtest.controller;

import com.practice.springboot.rabbitmqtest.config.DirectRabbitConfig;
import com.practice.springboot.rabbitmqtest.config.TopicModelRabbitConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class RabbitMqConsumer {
//    @RabbitListener(queues = DirectRabbitConfig.TestDirectQueue1)
//    public void receive(Message<String> message) {
//        System.out.println("message = " + message.getPayload());
//    }
//
//    @RabbitListener(queues = DirectRabbitConfig.TestDirectQueue2)
//    public void receive2(Message<String> message) {
//        System.out.println("message = " + message.getPayload());
//    }

    @RabbitListener(queues = TopicModelRabbitConfig.TestTopicQueue1)
    public void receiveTopic1(Message<String> message) {
        System.out.println(message.getPayload());
    }

//    @RabbitListener(queues = "TestQueueA")
//    public void receiveTopicA(Message<String> message) {
//        System.out.println(message.getPayload());
//    }
//
//    @RabbitListener(queues = "TestQueueB")
//    public void receiveTopicB(Message<String> message) {
//        System.out.println(message.getPayload());
//    }
//
//    @RabbitListener(queues = "TestQueueC")
//    public void receiveTopicC(Message<String> message) {
//        System.out.println(message.getPayload());
//    }
}
